package com.chen.controller;


import com.chen.entity.OrderReturnApply;
import com.chen.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 订单退货申请 前端控制器
 * </p>
 *
 * @author cws
 * @since 2024-11-30
 */
@RestController
@RequestMapping("/mall/orderReturnApply")
@Api(tags = "订单退货申请")
public class OrderReturnApplyController {

    @Resource
    private com.chen.service.OrderReturnApplyService orderReturnApplyService;

    @ApiModelProperty("添加订单退货申请")
    @PostMapping("/addOrderReturnApply")
    public Result addOrderReturnApply(@RequestBody OrderReturnApply orderReturnApply){
        return orderReturnApplyService.addOrderReturnApply(orderReturnApply);
    }



    @ApiModelProperty("获取退货详情")
    @GetMapping("/getOrderReturnApply")
    public Result getOrderReturnApply(@RequestParam("orderId") Long orderId,
                                            @RequestParam("productId") Long productId
                                            ){
        return orderReturnApplyService.getOrderReturnApply(orderId,productId);
    }


    @ApiModelProperty("修改退货申请")
    @PutMapping("/updateOrderReturnApply")
    public Result updateOrderReturnApply(@RequestBody OrderReturnApply orderReturnApply){
        return orderReturnApplyService.updateOrderReturnApply(orderReturnApply);
    }


}

